<html>
  <head>
    <title>gadgets.rpc Performance Tests: Gadget</title>
    <script src="../../js/rpc.js?c=1&debug=1"></script>
    <script src="rpctest_perf.js"></script>
    <script>
      var containerRelay = window.location.search.substring(1);
      gadgets.rpc.setRelayUrl(null, containerRelay);
    </script>
  </head>
  <body onload="initPerfTest();">
    <div>gadgets.rpc Performance: "Gadget" page</div><hr/>
    <div>Test<br/>
      <ul>
        <li>Number of messages to send:
          <select name="num_msgs" id="num_msgs">
            <option value="1">1</option>
            <option value="10">10</option>
            <option value="100" selected>100</option>
            <option value="1000">1000</option>
          </select>
        </li>
        <li>Message size:
          <select name="msg_size" id="msg_size">
            <option value="10">10 B</option>
            <option value="100">100 B</option>
            <option value="1024" selected>1 kB</option>
            <option value="10240">10 kB</option>
            <option value="102400">100 kB</option>
            <option value="1048576">1 MB</option>
          </select>
        </li>
        <li>
          <input type="button" value="Start The Test!" onclick="runPerfTest();" />
        </li>
      </ul>
    </div>
    <div id="test_running" style="display:none;">
      Running test...
    </div>
    <div id="results" style="display:none;">
      Results: Gadget-to-Container<br/>
      Messages: <span id="results_num_received"></span>, Bytes: <span id="results_bytes_received"></span> <span id="in_or_out"></span><br/>
      Time elapsed for test run: <span id="results_time_used"></span><br/>
      Messages/second: <span id="results_msgs_per_sec"></span><br/>
      Bytes/second: <span id="results_bytes_per_sec"></span>
    </div>
  </body>
</html>
